﻿using System.IO;
using Styx;
using Styx.Helpers;
using System.ComponentModel;
using DefaultValue = Styx.Helpers.DefaultValueAttribute;
using Styx.Common;
using Styx.Common.Helpers;
using System.Windows.Forms;
using System.Reflection;

namespace KingWoW
{
    [Obfuscation(Exclude = true)] 
    public class ArcaneMageSettings : Settings
    {
        public static ArcaneMageSettings Instance = new ArcaneMageSettings();

        public string path_name = Path.Combine(Styx.Common.Utilities.AssemblyDirectory, string.Format(@"KingWOWCurrentSettings/ArcaneMage/ArcaneMage-Settings-{0}.xml", StyxWoW.Me.Name));

        public ArcaneMageSettings()
            : base(Path.Combine(Styx.Common.Utilities.AssemblyDirectory, string.Format(@"KingWOWCurrentSettings/ArcaneMage/ArcaneMage-Settings-{0}.xml", StyxWoW.Me.Name)))
        {
        }

        [Setting]
        [DefaultValue(false)]
        [Category("MOVEMENT")]
        [DisplayName("Auto Move")]
        [Description("Enable/disable CC movement")]
        public bool movementEnabled { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("MULTIDOT")]
        [DisplayName("Avoid apply dot on player")]
        [Description("Avoid apply dot on player")]
        public bool AvoidDOTPlayers { get; set; }

        [Setting]
        [DefaultValue(3)]
        [Category("PRISMATIC CRYSTAL")]
        [DisplayName("PrismaticCrystalEnemiesNum")]
        [Description("use prismatic crystal if mobs number arount 8y of my main target are greater than this value")]
        public int PrismaticCrystalEnemiesNum { get; set; }

        [Setting]
        [DefaultValue(4)]
        [Category("PRISMATIC CRYSTAL")]
        [DisplayName("PrismaticCrystalChargesRequired")]
        [Description("use prismatic crystal Charges >= this value")]
        public int PrismaticCrystalChargesRequired { get; set; }

        /*[Setting]
        [DefaultValue(1)]
        [Category("PRISMATIC CRYSTAL")]
        [DisplayName("PrismaticCrystalMissilesRequired")]
        [Description("use prismatic crystal if Missiles >= this value")]
        public int PrismaticCrystalMissilesRequired { get; set; }*/

        [Setting]
        [DefaultValue(false)]
        [Category("PRISMATIC CRYSTAL")]
        [DisplayName("Use PrismaticCrystal ONLY on Burst Hotkey")]
        [Description("Use PrismaticCrystal ONLY on Burst Hotkey")]
        public bool PrismaticCrystalOnlyOnBurst { get; set; }

        public enum TargetType
        {
            MANUAL,
            AUTO
        }

        [Setting]
        [DefaultValue(true)]
        [Category("AOE")]
        [DisplayName("Use ConeOfCold")]
        [Description("Chose to enable/disable cone of cold when facing mob")]
        public bool UseConeOfCold { get; set; }

        [Setting]
        [DefaultValue(3)]
        [Category("AOE")]
        [DisplayName("ConeOfCold enemies number")]
        [Description("cast cone of cold when facing a value of mobs equals or greater than this value")]
        public int ConeOfColdCount { get; set; }

        [Setting]
        [DefaultValue(2)]
        [Category("AOE")]
        [DisplayName("Supenova enemies number")]
        [Description("cast Supenova when on pack of mobs equals or greater than this value")]
        public int SupernovaCount { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("AOE")]
        [DisplayName("Supenova on cooldown")]
        [Description("cast Supenova on cooldown")]
        public bool supernovaOnCooldown { get; set; }
        

        [Setting]
        [DefaultValue(true)]
        [Category("AOE")]
        [DisplayName("Supenova on single target")]
        [Description("cast Supenova on single target when on there is no pack of mobs equals or greater than Supenova enemies number")]
        public bool SupernovaOnSingle { get; set; }

        [Setting]
        [DefaultValue(15)]
        [Category("DEFENSIVE")]
        [DisplayName("ColdSnapHP")]
        [Description("Use ColdSnap if hp lower than this value")]
        public int ColdSnapHP { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("DEFENSIVE")]
        [DisplayName("Use ColdSnap")]
        [Description("Chose to enable/disable automatic ColdSnap")]
        public bool ColdSnapUse { get; set; }

        [Setting]
        [DefaultValue(15)]
        [Category("DEFENSIVE")]
        [DisplayName("EvanesceHP")]
        [Description("Use Evanesce if hp lower than this value")]
        public int EvanesceHP { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("DEFENSIVE")]
        [DisplayName("Use Evanesce")]
        [Description("Chose to enable/disable automatic Evanesce")]
        public bool EvanesceUse { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("DECURSE")]
        [DisplayName("UseDecurse")]
        [Description("Autocast remove curse on friends")]
        public bool UseDecurse { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("INTERRUPT")]
        [DisplayName("autointerrupt")]
        [Description("Cast counterspell if target casting and interrumpible")]
        public bool AutoInterrupt { get; set; }

        [Setting]
        [DefaultValue(200)]
        [Category("INTERRUPT")]
        [DisplayName("Interrupt_MIN_Time")]
        [Description("Interrupt if enemy cast time between Interrupt_MIN_Time and Interrupt_MAX_Time")]
        public int Interrupt_MIN_Time { get; set; }

        [Setting]
        [DefaultValue(300)]
        [Category("INTERRUPT")]
        [DisplayName("Interrupt_MAX_Time")]
        [Description("Interrupt if enemy cast time between Interrupt_MIN_Time and Interrupt_MAX_Time")]
        public int Interrupt_MAX_Time { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("MOVEMENT")]
        [DisplayName("AutoFacingTarget")]
        [Description("Enable/Disable autofacing current target")]
        public bool AutofaceTarget { get; set; }

        [Setting]
        [DefaultValue(TargetType.AUTO)]
        [Category("TARGETTING")]
        [DisplayName("TargetTypeSelected")]
        [Description("AUTO/MANUAL enable/disable autotargeting")]
        public TargetType TargetTypeSelected { get; set; }

        [Setting]
        [DefaultValue(40)]
        [Category("PULL")]
        [DisplayName("PullDistance")]
        [Description("Distance to pull from")]
        public float PullDistance { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("SPECIAL")]
        [DisplayName("AutoDismountOnCombat")]
        [Description("Auto start combat rotation when in combat and mounted")]
        public bool AutoDismountOnCombat { get; set; }
        
        [Setting]
        [DefaultValue(true)]
        [Category("BUFF")]
        [DisplayName("Autobuff brillance")]
        [Description("chose if buff arcane brillance automatic or manual")]
        public bool AutoBuffBrillance { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("BUFF")]
        [DisplayName("AutoCast Ice Floes on moving")]
        [Description("AutoCast Ice Floes on moving (if talented)")]
        public bool autoIceFloes { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("CROWD CONTROL")]
        [DisplayName("IceWardOnTank")]
        [Description("chose if automatically cast Ice ward on Tank")]
        public bool IceWardOnTank { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("ICE BARRIER")]
        [DisplayName("UseIcebarrier")]
        [Description("Enable/disable use of Ice barrier")]
        public bool UseIcebarrier { get; set; }

        [Setting]
        [DefaultValue(80)]
        [Category("ICE BARRIER")]
        [DisplayName("IcebarrierHP")]
        [Description("Use Ice barrier if my HP lower than this value")]
        public int IcebarrierHP { get; set; }

        [Setting]
        [DefaultValue(50)]
        [Category("REST")]
        [DisplayName("Drink mana%")]
        [Description("Drink at % mana")]
        public int ManaPercent { get; set; }

        [Setting]
        [DefaultValue(50)]
        [Category("REST")]
        [DisplayName("Eat hp%")]
        [Description("Eat at % hp")]
        public int HealthPercent { get; set; }

        [Setting]
        [DefaultValue(4)]
        [Category("AOE")]
        [DisplayName("AOE on #mobs")]
        [Description("use AOE spells if mobs number >= this value")]
        public int AOECount { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("AOE")]
        [DisplayName("AvoidAOESpells")]
        [Description("Try to avoid AOE spells ")]
        public bool AvoidAOE { get; set; }  

        public enum CDUseType
        {
            COOLDOWN,
            BOSS,
            MANUAL,
            OnBURSTHOTKEY
        }

        [Setting]
        [DefaultValue(CDUseType.COOLDOWN)]
        [Category("CD")]
        [DisplayName("Use ArcanePower CD on")]
        [Description("Chose when use ArcanePower CD")]
        public CDUseType CDUseArcanePower { get; set; }

        [Setting]
        [DefaultValue(CDUseType.COOLDOWN)]
        [Category("CD")]
        [DisplayName("Use Mirror Image CD on")]
        [Description("Chose when use your Mirror Image CD")]
        public CDUseType CDUseMirrorImage { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("CROWD CONTROL")]
        [DisplayName("UseRingOfFrost")]
        [Description("Chose to enable/disable use of ring of frost")]
        public bool UseRingOfFrost { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("SPECIAL")]
        [DisplayName("Use Blink")]
        [Description("Chose to enable/disable automatic Blink")]
        public bool UseBlink { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("TALENT")]
        [DisplayName("Use RuneOfPower")]
        [Description("Chose to enable/disable if talented RuneOfPower")]
        public bool UseRuneOfPower { get; set; }

        [Setting]
        [DefaultValue(15)]
        [Category("DEFENSIVE")]
        [DisplayName("IceBlockHP")]
        [Description("Use Ice Block if hp lower than this value")]
        public int IceBlockHP { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("DEFENSIVE")]
        [DisplayName("Use Ice Block")]
        [Description("Chose to enable/disable automatic IceBlock")]
        public bool IceBlockUse { get; set; }

        [Setting]
        [DefaultValue(50)]
        [Category("EVOCATION BURN PHASE")]
        [DisplayName("Evocation at mana %")]
        [Description("Use Evocation if talented and your mana % lower tan this value")]
        public int EvocationToRecMana { get; set; }

        [Setting]
        [DefaultValue(3)]
        [Category("EVOCATION BURN PHASE")]
        [DisplayName("TimeSecondsEvocationAgainUp")]
        [Description("Go on Burn Mana phase if Evocation CD less than this value")]
        public int TimeSecondsEvocationAgainUp { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("EVOCATION BURN PHASE")]
        [DisplayName("UseEvocationBurnPhase")]
        [Description("UseEvocationBurnPhase: if evocation is available to cast, then CR will consume mana until Evocation at mana %")]
        public bool UseEvocationBurnPhase { get; set; }
        
        [Setting]
        [DefaultValue(false)]
        [Category("SPECIAL")]
        [DisplayName("UseSpellSteal")]
        [Description("UseSpellSteal on focused target if exist or Current target")]
        public bool UseSpellSteal { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("CROWD CONTROL")]
        [DisplayName("UsePolymorf")]
        [Description("UsePolymorf on focused target")]
        public bool UsePolymorf { get; set; }

        [Setting, DefaultValue(Keys.None)]
        [Category("HOTKEY")]
        [DisplayName("PauseKey")]
        [Description("enable/disable Routine")]
        public Keys PauseKey { get; set; }

        [Setting, DefaultValue(Keys.None)]
        [Category("HOTKEY")]
        [DisplayName("AvoidAOEKey")]
        [Description("enable/disable AvoidAOE function")]
        public Keys AvoidAOEKey { get; set; }

        [Setting, DefaultValue(Keys.None)]
        [Category("HOTKEY")]
        [DisplayName("BurstKey")]
        [Description("Cast all CD and spells set on BurstHOTKEY")]
        public Keys BurstKey { get; set; }

    }
}
